import type { FormInstance, FormRules } from 'element-plus'
export interface User {
  id: number | string
  username: string
  name: string;
  phone: string;
  sex: string;
  idNumber: string;
}

export const getUseFormRules = () => {
  return ({
    username: [{ required: true, message: '请填写账号', trigger: 'blur' }],
    name: [{ required: true, message: '请填写名字', trigger: 'blur' }],
    phone: [{ required: true, message: '请填写电话', trigger: 'blur' }],
    sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
    idNumber: [{ required: true, message: '请填写身份证号', trigger: 'blur' }],
  })
}

export const geMenuFormRules = () => {
  return ({
    name: [{ required: true, message: '请填写菜单名', trigger: 'blur' }],
    path: [{ required: true, message: '请填写路由路径', trigger: 'blur' }],
    sort: [{ required: true, message: '请填写序号', trigger: 'blur' }],
    type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
  })
}